package com.sqsf.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sqsf.mapper.UserMapper;
import com.sqsf.javabean.User;
import com.sqsf.service.UserService;

@Service
@Transactional
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> findAll() {
        return userMapper.selectAllUsers();
    }

    @Override
    public boolean add(User user) {
        int result = userMapper.insertUser(user);
        return result > 0;
    }
}